home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / kernel / ai.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-05  |  1.8 KB  |  50 lines  |  [TEXT/KAHL]

  1. /* Definitions common to all AIs.
  2.    Copyright (C) 1992, 1993, 1994 Stanley T. Shebs.
  3.  
  4. Xconq is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.  See the file COPYING.  */
  8.  
  9. typedef enum {
  10.     nobrains = 0,
  11.     mplayertype = 1
  12.     /* plus other types as defined */
  13. #ifdef MPW_C
  14.     /* Works around an MPW C bug where byte-sized enums lose - symptom
  15.        is that AIs never do anything. */
  16.     , aitype_intifier = 1000000
  17. #endif /* MPW_C */
  18. } AIType;
  19.  
  20. /* Definition common to all ai type. (?) */
  21.  
  22. typedef struct a_ai {
  23.   AIType type;
  24. } AI;
  25.  
  26. #define side_ai_type(s) (((AI *) (s)->ai)->type)
  27.  
  28. /* Add declaration of AI hooks here. */
  29.  
  30. extern char *aitypenames[];
  31.  
  32. extern void init_ai PROTO ((Side *side));
  33. extern void set_side_ai PROTO ((Side *side, char *typename));
  34. extern void ai_init_turn PROTO ((Side *side));
  35. extern void ai_decide_plan PROTO ((Side *side, Unit *unit));
  36. extern void ai_react_to_unit_loss PROTO ((Side *side, Unit *unit));
  37. extern void ai_react_to_action_result PROTO ((Side *side, Unit *unit,
  38.                           int rslt));
  39. extern void ai_react_to_task_result PROTO ((Side *side, Unit *unit,
  40.                         Task *task, int rslt));
  41. extern int ai_guide_explorer PROTO ((Side *side, Unit *unit));
  42. extern int ai_preferred_build_type PROTO ((Side *side, Unit *unit,
  43.                        int plantype));
  44. extern void ai_finish_movement PROTO ((Side *side));
  45. extern void ai_receive_message PROTO ((Side *side, Side *sender, char *str));
  46. extern void ai_write_state PROTO ((FILE *fp, Side *side));
  47. extern void ai_read_state PROTO ((Side *side, Obj *data));
  48. extern int ai_region_at PROTO ((Side *side, int x, int y));
  49. extern char *ai_at_desig PROTO ((Side *side, int x, int y));
  50.